home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9641 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: inforamp.net!ts1-10
  2. From: rmorin@inforamp.net (Randy Charles Morin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help!   C++ undef array problem
  5. Date: Sun, 03 Mar 96 07:32:54 GMT
  6. Organization: MiddleWorld SoftWare
  7. Message-ID: <4hbhur$899@sam.inforamp.net>
  8. References: <4gnrm0$gcq@vista.hevanet.com>
  9. NNTP-Posting-Host: ts1-10.tor.inforamp.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. In article <4gnrm0$gcq@vista.hevanet.com>, Lefty@hevanet.com (Lefty) wrote:
  13. >Shouldn't the integer 3 in (*GetModule(),"fish",3) be passed to Sea.cpp and 
  14. Sea.h 
  15.  
  16. Nope.  Try the following.
  17.  
  18. >
  19. >//************************** Lefty.cpp 
  20. ************************************************************
  21. >#include <owl\applicat.h>
  22. >#include <owl\framewin.h>
  23. >#inclued <owl\dc.h>
  24. >#include Sea.h
  25. >
  26. >class Try : public TFrameWindow 
  27. >{
  28. >     public:
  29. >    Try(TWindow *parent, const char far *title);
  30. >     private:
  31. >    Sea* Animation        
  32. >}:
  33. >    
  34. >Try::Try(TWindow *parent, const char far *title) : TFrameWindow(parent, 
  35. title)
  36. >{
  37. >    Animation = new Sea(*GetModule(),"fish",3);
  38. >}
  39. >
  40. >
  41. >
  42. >// *************************** Sea.h 
  43. *****************************************************************
  44. >class Sea                        {
  45. >     public: 
  46. >    Sea::Sea(HINSTANCE hInst, char far* name, int n);
  47. >     private:
  48. >    int *bx;               };
  49. >
  50. >
  51. >
  52. >// **************************** Sea.cpp 
  53. **************************************************************
  54. >#include <owl\applicat.h>
  55. >#include <owl\framewin.h>
  56. >#inclued <owl\dc.h>
  57. >#include Sea.h
  58. >
  59. >Sea::Sea(HINSTANCE hInst, char far* name, int n)
  60. >{
  61. >    bx = new int[n];
  62. >     for(int i=1;i<=n;i++)  {
  63. >    bx[i]= 3            }
  64. >}
  65.